let express = require('express');
let cors = require('cors');
let app = express();
const bodyparser = require('body-parser');
const interceptor = require('./middleware/interceptor');
const RouterPath = require('./router/path/path');
// 解决跨域
app.use(cors());
app.use(bodyparser())
// 拦截器
app.use(interceptor)

for (var i = 0; i < RouterPath.length; i++) {
    app.use(RouterPath[i].path,require(RouterPath[i].component));
}

app.listen(8848,()=>{
    console.log("http://127.0.0.1:8848");
})